package com.jinher.lib.Const
{
	import com.jinher.lib.Common;
	import com.jinher.lib.Module.Login;

	public final class AppConst
	{
		private static var path:String="app:/assets/config/appconfig.xml";

		//数据库路径
		public static function get DbPath():String
		{
			return "app:/assets/db/data.db";
		}

		//备份文件地址
		public static function get BakPath():String
		{
			return "app:/config/bak.xml";
		}

		//缓存时间
		public static function get CacheTimeout():int
		{
			return Number(Common.getXmlItem(path, "cache/timeout"));
		}

		//网络监听地址，用来判断网络是否通畅
		public static function get MonitorUrl():String
		{
			return Common.getXmlItem(path, "app/monitorurl").toString();
		}

		//返回登录窗口信息
		public static function get LoginInfo():Login
		{
			var loginInfo:Login=new Login();
			var xmlNode:XMLList=Common.getXmlNode(path, "login");
			loginInfo.Width=Number(xmlNode.child("width"));
			loginInfo.Height=Number(xmlNode.child("height"));
			loginInfo.Modal=Boolean(xmlNode.child("modal"));
			loginInfo.Drag=Boolean(xmlNode.child("drag"));
			return loginInfo;
		}
	}
}
